/*
 * @Author: szx
 * @Date: 2021-12-01 12:50:50
 * @LastEditTime: 2021-12-01 12:55:30
 * @Description:
 * @FilePath: \leetcode\1400-1499\1446\1446.js
 */
/**
 * @param {string} s
 * @return {number}
 */
var maxPower = function (s) {
    let ch = s[0];
    let res = 1,
        tmp = 1;

    for (let i = 1; i < s.length; i++) {
        if (ch == s[i]) {
            tmp++;
        } else {
            res = Math.max(tmp, res);
            tmp = 1;
            ch = s[i];
        }
    }
    return Math.max(tmp, res);
};
